From afbfccb89ebc8abf63e5e1d5248b5136a250656d Mon Sep 17 00:00:00 2001 From: Peter Bloomfield Date: Sun, 3 Mar 2019 18:21:10 -0500 Subject: [PATCH] notebook: Notify the notebook page, not the child Call g_object_notify() on the GtkNotebookPage, not the child GtkWidget. Fixes some issues in !594. --- gtk/gtknotebook.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 8f32b457d0..d11ee42584 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -6634,7 +6634,7 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook, if (priv->menu) gtk_notebook_menu_item_recreate (notebook, list); - g_object_notify (G_OBJECT (child), "tab-label"); + g_object_notify (G_OBJECT (page), "tab-label"); } /** @@ -6764,7 +6764,7 @@ gtk_notebook_set_menu_label (GtkNotebook *notebook, if (priv->menu) gtk_notebook_menu_item_create (notebook, page); - g_object_notify (G_OBJECT (child), "menu-label"); + g_object_notify (G_OBJECT (page), "menu-label"); } /** @@ -6791,7 +6791,6 @@ gtk_notebook_set_menu_label_text (GtkNotebook *notebook, gtk_widget_set_valign (menu_label, GTK_ALIGN_CENTER); } gtk_notebook_set_menu_label (notebook, child, menu_label); - g_object_notify (G_OBJECT (child), "menu-label"); } /** @@ -7031,7 +7030,7 @@ gtk_notebook_set_tab_reorderable (GtkNotebook *notebook, else gtk_style_context_remove_class (gtk_widget_get_style_context (page->tab_widget), "reorderable-page"); - g_object_notify (G_OBJECT (child), "reorderable"); + g_object_notify (G_OBJECT (page), "reorderable"); } } @@ -7114,6 +7113,7 @@ gtk_notebook_set_tab_detachable (GtkNotebook *notebook, gboolean detachable) { GList *list; + GtkNotebookPage *page; g_return_if_fail (GTK_IS_NOTEBOOK (notebook)); g_return_if_fail (GTK_IS_WIDGET (child)); @@ -7121,12 +7121,13 @@ gtk_notebook_set_tab_detachable (GtkNotebook *notebook, list = gtk_notebook_find_child (notebook, child); g_return_if_fail (list != NULL); + page = GTK_NOTEBOOK_PAGE_FROM_LIST (list); detachable = detachable != FALSE; - if (GTK_NOTEBOOK_PAGE_FROM_LIST (list)->detachable != detachable) + if (page->detachable != detachable) { - GTK_NOTEBOOK_PAGE_FROM_LIST (list)->detachable = detachable; - g_object_notify (G_OBJECT (child), "detachable"); + page->detachable = detachable; + g_object_notify (G_OBJECT (page), "detachable"); } } -- 2.30.2